package br.com.basili.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

@Entity
public class Planning 
{
	@Id
	@GeneratedValue
	@Column(name = "planning_id")
	private int    id;
	@Lob
	private String studyObject;
	@Lob
	private String globalObjective;
	@Lob
	private String nullHypotheses;
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY )
	@JoinTable(name = "PLANNING_AH", 
	           joinColumns = {@JoinColumn(name="planning_id")}, 
	           inverseJoinColumns={@JoinColumn(name="ah_id")})
	private List<AlternativeHypotheses> alternativeHypotheses = new ArrayList<AlternativeHypotheses>();
	@Lob
	private String subjectSelection;
	@Lob
	private String groupCriteria;
	@Lob
	private String resources;
	@Lob
	private String experimentsDesign;
	@Lob
	private String Instrumentation;
	@Lob
	private String analysisMechanisms;
	@Lob
	private String internalValidity;
	@Lob
	private String externalValidity;
	@Lob
	private String conclusionValidity;
	@Lob
	private String constructionValidity;
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY )
	@JoinTable(name = "PLANNING_GROUP", 
	           joinColumns = {@JoinColumn(name="planning_id")}, 
	           inverseJoinColumns={@JoinColumn(name="group_id")})
	private List<Troop> groups = new ArrayList<Troop>();
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY )
	@JoinTable(name = "PLANNING_VARIABLE", 
	           joinColumns = {@JoinColumn(name="planning_id")}, 
	           inverseJoinColumns={@JoinColumn(name="varible_id")})
	private List<Variable> variables;
	
	@OneToOne
	@JoinColumn( name = "cod_protocol", insertable = true, updatable = false)
	private Protocol protocol;
	
	public Planning( )
	{
		// TODO Auto-generated constructor stub
	}
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getStudyObject() {
		return studyObject;
	}

	public void setStudyObject(String studyObject) {
		this.studyObject = studyObject;
	}

	public String getGlobalObjective() {
		return globalObjective;
	}

	public void setGlobalObjective(String globalObjective) {
		this.globalObjective = globalObjective;
	}

	public String getNullHypotheses() {
		return nullHypotheses;
	}

	public void setNullHypotheses(String nullHypotheses) {
		this.nullHypotheses = nullHypotheses;
	}

	public List<AlternativeHypotheses> getAlternativeHypotheses() {
		return alternativeHypotheses;
	}

	public void setAlternativeHypotheses(List<AlternativeHypotheses> alternativeHypotheses) {
		this.alternativeHypotheses = alternativeHypotheses;
	}

	public String getSubjectSelection() {
		return subjectSelection;
	}

	public void setSubjectSelection(String subjectSelection) {
		this.subjectSelection = subjectSelection;
	}

	public String getGroupCriteria() {
		return groupCriteria;
	}

	public void setGroupCriteria(String groupCriteria) {
		this.groupCriteria = groupCriteria;
	}

	public String getResources() {
		return resources;
	}

	public void setResources(String resources) {
		this.resources = resources;
	}

	public String getExperimentsDesign() {
		return experimentsDesign;
	}

	public void setExperimentsDesign(String experimentsDesign) {
		this.experimentsDesign = experimentsDesign;
	}

	public String getInstrumentation() {
		return Instrumentation;
	}

	public void setInstrumentation(String instrumentation) {
		Instrumentation = instrumentation;
	}

	public String getAnalysisMechanisms() {
		return analysisMechanisms;
	}

	public void setAnalysisMechanisms(String analysisMechanisms) {
		this.analysisMechanisms = analysisMechanisms;
	}

	public String getInternalValidity() {
		return internalValidity;
	}

	public void setInternalValidity(String internalValidity) {
		this.internalValidity = internalValidity;
	}

	public String getExternalValidity() {
		return externalValidity;
	}

	public void setExternalValidity(String externalValidity) {
		this.externalValidity = externalValidity;
	}

	public String getConclusionValidity() {
		return conclusionValidity;
	}

	public void setConclusionValidity(String conclusionValidity) {
		this.conclusionValidity = conclusionValidity;
	}

	public String getConstructionValidity() {
		return constructionValidity;
	}

	public void setConstructionValidity(String constructionValidity) {
		this.constructionValidity = constructionValidity;
	}

	public List<Troop> getGroups() {
		return groups;
	}

	public void setGroups(List<Troop> groups) {
		this.groups = groups;
	}

	public List<Variable> getVariables() {
		return variables;
	}

	public void setVariables(List<Variable> variables) {
		this.variables = variables;
	}

	public Protocol getProtocol() {
		return protocol;
	}

	public void setProtocol(Protocol protocol) {
		this.protocol = protocol;
	}
	
}